<?php use_javascript('/js/form.js') ?>

<div class="admin_form_row">
  <div>
    <?php if ($form['modulos']->hasError()): ?>
      <div class="error">Existen datos no válidos</div>
    <?php endif; ?>
    <?php echo $form['modulos']->renderLabel() ?>

    <div class="content">
      <table id="tbModulos" class="form_table">
        <thead>
        <tr>
          <th style="width: 20px"></th>
          <th>Título</th>
          <th>Objeto T.</th>
          <th>Número</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($form['modulos'] as $moduloFields): ?>
          <?php include_partial('modulos_fields', array('moduloFields' => $moduloFields))?>
          <?php endforeach; ?>
        </tbody>
      </table>
      <br>
      <ul class="admin_actions">
        <li class="admin_action_new"><a href="#" id="addModulo">Agregar módulo</a></li>
      </ul>
    </div>
  </div>
</div>

<script type="text/javascript">
  /* <![CDATA[ */
  //form.js
  $(function () { 
    iniciaTablaForm('#tbModulos', '#addModulo', '.delModulo', '<?php echo url_for('@malla_curricular_agregaModulo')?>');
  });
  /* ]]> */
</script>
